<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SWM34S_LVGL7.11_SWMUI: C:/Users/DELL/Desktop/Commit/lvgl/SWM34S_LVGL7.11_SWMUI_20230515/APP/BSP/dev_io_i2c.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SWM34S_LVGL7.11_SWMUI<span id="projectnumber">&#160;V7.9</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_0ca16891106f5a3e9ad635a0d6c5f98f.html">APP</a></li><li class="navelem"><a class="el" href="dir_4ca18d753a70f6eada20fde478bd3fc8.html">BSP</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle"><div class="title">dev_io_i2c.h 文件参考</div></div>
</div><!--header-->
<div class="contents">

<p>IO 模拟 IIC 通讯接口  
<a href="#details">更多...</a></p>
<div class="textblock"><code>#include &quot;stdint.h&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
dev_io_i2c.h 的引用(Include)关系图:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h__incl.png" border="0" usemap="#a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8h" alt=""/></div>
<map name="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8h" id="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8h">
<area shape="rect" title="IO 模拟 IIC 通讯接口" alt="" coords="5,5,228,75"/>
<area shape="rect" title=" " alt="" coords="84,123,149,148"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
此图展示该文件直接或间接的被哪些文件引用了:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h__dep__incl.png" border="0" usemap="#a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8hdep" alt=""/></div>
<map name="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8hdep" id="a_c_1_2_users_2_d_e_l_l_2_desktop_2_commit_2lvgl_2_s_w_m34_s___l_v_g_l7_811___s_w_m_u_i__20230515_2_a_p_p_2_b_s_p_2dev__io__i2c_8hdep">
<area shape="rect" title="IO 模拟 IIC 通讯接口" alt="" coords="868,5,1091,75"/>
<area shape="rect" href="dev__io__i2c_8c.html" title="IO 模拟 IIC 通讯接口" alt="" coords="5,123,228,192"/>
<area shape="rect" href="_t_p___c_s_t328_8c.html" title="本例程为触摸 IC 驱动: CST328(海栎创)" alt="" coords="252,123,475,192"/>
<area shape="rect" href="_t_p___c_s_t826_8c.html" title="本例程为触摸 IC 驱动: CST826(海栎创)" alt="" coords="499,123,721,192"/>
<area shape="rect" href="_t_p___f_t5206_8c.html" title="本例程为触摸 IC 驱动: FT5206 敦泰电子(FocalTech)" alt="" coords="745,123,968,192"/>
<area shape="rect" href="_t_p___f_t6336_8c.html" title="本例程为触摸 IC 驱动: FT6336 敦泰电子(FocalTech)" alt="" coords="992,123,1215,192"/>
<area shape="rect" href="_t_p___g_t911_8c.html" title="本例程为触摸 IC 驱动: GT911(汇顶科技)" alt="" coords="1239,123,1461,192"/>
<area shape="rect" href="_t_p___i_l_i2117_a_8c.html" title="本例程为触摸 IC 驱动: ILI2117A(奕力)" alt="" coords="1485,123,1708,192"/>
<area shape="rect" href="_t_p___tango___c32_8c.html" title="本例程为触摸 IC 驱动: Tango C32( &lt;PIXCIR&gt; 瀚瑞微)" alt="" coords="1732,123,1955,192"/>
</map>
</div>
</div>
<p><a href="dev__io__i2c_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:af312bd95bfab5d6c323eb36deea573cf"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dev__io__i2c_8h.html#af312bd95bfab5d6c323eb36deea573cf">io_i2c_start</a> (uint8_t addr, uint8_t wait)</td></tr>
<tr class="memdesc:af312bd95bfab5d6c323eb36deea573cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">IO 模拟标准 I2C, 主设备产生起始信号并发送设备地址  <a href="dev__io__i2c_8h.html#af312bd95bfab5d6c323eb36deea573cf">更多...</a><br /></td></tr>
<tr class="separator:af312bd95bfab5d6c323eb36deea573cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18a19719c37d180525d3ad812408c62a"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dev__io__i2c_8h.html#a18a19719c37d180525d3ad812408c62a">io_i2c_read</a> (uint8_t ack, uint8_t wait)</td></tr>
<tr class="memdesc:a18a19719c37d180525d3ad812408c62a"><td class="mdescLeft">&#160;</td><td class="mdescRight">IO 模拟标准 I2C, 主设备读取一个数据  <a href="dev__io__i2c_8h.html#a18a19719c37d180525d3ad812408c62a">更多...</a><br /></td></tr>
<tr class="separator:a18a19719c37d180525d3ad812408c62a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d0792f91f99fe78d977675f315b8b99"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dev__io__i2c_8h.html#a4d0792f91f99fe78d977675f315b8b99">io_i2c_write</a> (uint8_t data, uint8_t wait)</td></tr>
<tr class="memdesc:a4d0792f91f99fe78d977675f315b8b99"><td class="mdescLeft">&#160;</td><td class="mdescRight">IO 模拟标准 I2C, 主设备写入一个数据  <a href="dev__io__i2c_8h.html#a4d0792f91f99fe78d977675f315b8b99">更多...</a><br /></td></tr>
<tr class="separator:a4d0792f91f99fe78d977675f315b8b99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addb2a5d40257d803646950da9167bccb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dev__io__i2c_8h.html#addb2a5d40257d803646950da9167bccb">io_i2c_stop</a> (uint8_t wait)</td></tr>
<tr class="memdesc:addb2a5d40257d803646950da9167bccb"><td class="mdescLeft">&#160;</td><td class="mdescRight">IO 模拟标准 I2C, 主设备产生停止信号  <a href="dev__io__i2c_8h.html#addb2a5d40257d803646950da9167bccb">更多...</a><br /></td></tr>
<tr class="separator:addb2a5d40257d803646950da9167bccb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p >IO 模拟 IIC 通讯接口 </p>
<p >/ </p><dl class="section since"><dt>自从</dt><dd>Change Logs: Date Author Notes 2022-12-08 rk the first version 2023-04-25 lzh 重写 </dd></dl>
<dl class="section remark"><dt>备注</dt><dd>后续增添超时抛出流程</dd></dl>
<dl class="section attention"><dt>注意</dt><dd></dd></dl>
<p>THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, SYNWIT SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONN- -ECTION WITH THEIR PRODUCTS.</p>
<dl class="section copyright"><dt>版权所有</dt><dd>2012 Synwit Technology </dd></dl>

<p class="definition">在文件 <a class="el" href="dev__io__i2c_8h_source.html">dev_io_i2c.h</a> 中定义.</p>
</div><h2 class="groupheader">函数说明</h2>
<a id="af312bd95bfab5d6c323eb36deea573cf" name="af312bd95bfab5d6c323eb36deea573cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af312bd95bfab5d6c323eb36deea573cf">&#9670;&#160;</a></span>io_i2c_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t io_i2c_start </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>wait</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>IO 模拟标准 I2C, 主设备产生起始信号并发送设备地址 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>: 传输从设备地址数据 </td></tr>
    <tr><td class="paramname">wait</td><td>: 此参数暂无作用, 是为了与硬件 I2C 库函数接口保持一致 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>: 接收到 ACK </td></tr>
    <tr><td class="paramname">0</td><td>: 接收到 NACK </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="dev__io__i2c_8c_source.html">dev_io_i2c.c</a> 第 <a class="el" href="dev__io__i2c_8c_source.html#l00132">132</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h_af312bd95bfab5d6c323eb36deea573cf_cgraph.png" border="0" usemap="#adev__io__i2c_8h_af312bd95bfab5d6c323eb36deea573cf_cgraph" alt=""/></div>
<map name="adev__io__i2c_8h_af312bd95bfab5d6c323eb36deea573cf_cgraph" id="adev__io__i2c_8h_af312bd95bfab5d6c323eb36deea573cf_cgraph">
<area shape="rect" title="IO 模拟标准 I2C, 主设备产生起始信号并发送设备地址" alt="" coords="5,80,95,105"/>
<area shape="rect" href="dev__io__i2c_8c.html#a268a94eb25b4c8a9d88a83259930b2df" title="I2C 主设备传输 8 位数据" alt="" coords="147,5,269,31"/>
<area shape="rect" href="dev__io__i2c_8c.html#abb9c2429dbe2c1095dc3ec66a0b79a11" title="I2C 总线启动前仲裁, 若总线(高电平)空闲则发起总线起始时序" alt="" coords="143,55,273,80"/>
<area shape="rect" href="dev__io__i2c_8c.html#a2f2fd2dc0cabe8d5843a078348d9920f" title="IIC 主设备产生停止信号" alt="" coords="143,104,273,129"/>
<area shape="rect" href="dev__io__i2c_8c.html#a507c871d4232488d9f36c335cea78bad" title="I2C 主设备接收应答信号" alt="" coords="151,153,265,179"/>
<area shape="rect" href="dev__io__i2c_8c.html#ab80cac38a78cf222153cd721d4801a3a" title="IIC 通讯的延时保持" alt="" coords="321,80,416,105"/>
</map>
</div>

</div>
</div>
<a id="a18a19719c37d180525d3ad812408c62a" name="a18a19719c37d180525d3ad812408c62a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18a19719c37d180525d3ad812408c62a">&#9670;&#160;</a></span>io_i2c_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t io_i2c_read </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>ack</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>wait</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>IO 模拟标准 I2C, 主设备读取一个数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ack</td><td>: 1 发送ACK 0 发送NACK </td></tr>
    <tr><td class="paramname">wait</td><td>: 此参数暂无作用, 是为了与硬件 I2C 库函数接口保持一致 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">读取到的数据</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="dev__io__i2c_8c_source.html">dev_io_i2c.c</a> 第 <a class="el" href="dev__io__i2c_8c_source.html#l00153">153</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h_a18a19719c37d180525d3ad812408c62a_cgraph.png" border="0" usemap="#adev__io__i2c_8h_a18a19719c37d180525d3ad812408c62a_cgraph" alt=""/></div>
<map name="adev__io__i2c_8h_a18a19719c37d180525d3ad812408c62a_cgraph" id="adev__io__i2c_8h_a18a19719c37d180525d3ad812408c62a_cgraph">
<area shape="rect" title="IO 模拟标准 I2C, 主设备读取一个数据" alt="" coords="5,31,93,56"/>
<area shape="rect" href="dev__io__i2c_8c.html#ab7222883cb247799343ee48f43c677af" title="I2C 主设备接收 8bit 数据" alt="" coords="141,5,260,31"/>
<area shape="rect" href="dev__io__i2c_8c.html#a95625ec003f9bd0e827493aa2465f483" title="I2C 主设备发送应答信号" alt="" coords="141,55,260,80"/>
<area shape="rect" href="dev__io__i2c_8c.html#ab80cac38a78cf222153cd721d4801a3a" title="IIC 通讯的延时保持" alt="" coords="308,31,403,56"/>
</map>
</div>

</div>
</div>
<a id="a4d0792f91f99fe78d977675f315b8b99" name="a4d0792f91f99fe78d977675f315b8b99"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d0792f91f99fe78d977675f315b8b99">&#9670;&#160;</a></span>io_i2c_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t io_i2c_write </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>wait</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>IO 模拟标准 I2C, 主设备写入一个数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>: 要写的数据 </td></tr>
    <tr><td class="paramname">wait</td><td>: 此参数暂无作用, 是为了与硬件 I2C 库函数接口保持一致 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">1</td><td>: 接收到 ACK </td></tr>
    <tr><td class="paramname">0</td><td>: 接收到 NACK </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="dev__io__i2c_8c_source.html">dev_io_i2c.c</a> 第 <a class="el" href="dev__io__i2c_8c_source.html#l00168">168</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h_a4d0792f91f99fe78d977675f315b8b99_cgraph.png" border="0" usemap="#adev__io__i2c_8h_a4d0792f91f99fe78d977675f315b8b99_cgraph" alt=""/></div>
<map name="adev__io__i2c_8h_a4d0792f91f99fe78d977675f315b8b99_cgraph" id="adev__io__i2c_8h_a4d0792f91f99fe78d977675f315b8b99_cgraph">
<area shape="rect" title="IO 模拟标准 I2C, 主设备写入一个数据" alt="" coords="5,31,96,56"/>
<area shape="rect" href="dev__io__i2c_8c.html#a268a94eb25b4c8a9d88a83259930b2df" title="I2C 主设备传输 8 位数据" alt="" coords="144,5,267,31"/>
<area shape="rect" href="dev__io__i2c_8c.html#a507c871d4232488d9f36c335cea78bad" title="I2C 主设备接收应答信号" alt="" coords="148,55,263,80"/>
<area shape="rect" href="dev__io__i2c_8c.html#ab80cac38a78cf222153cd721d4801a3a" title="IIC 通讯的延时保持" alt="" coords="315,31,409,56"/>
</map>
</div>

</div>
</div>
<a id="addb2a5d40257d803646950da9167bccb" name="addb2a5d40257d803646950da9167bccb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addb2a5d40257d803646950da9167bccb">&#9670;&#160;</a></span>io_i2c_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void io_i2c_stop </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>wait</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>IO 模拟标准 I2C, 主设备产生停止信号 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">wait</td><td>: 此参数暂无作用, 是为了与硬件 I2C 库函数接口保持一致 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">/</td><td></td></tr>
  </table>
  </dd>
</dl>

<p class="definition">在文件 <a class="el" href="dev__io__i2c_8c_source.html">dev_io_i2c.c</a> 第 <a class="el" href="dev__io__i2c_8c_source.html#l00179">179</a> 行定义.</p>
<div class="dynheader">
函数调用图:</div>
<div class="dyncontent">
<div class="center"><img src="dev__io__i2c_8h_addb2a5d40257d803646950da9167bccb_cgraph.png" border="0" usemap="#adev__io__i2c_8h_addb2a5d40257d803646950da9167bccb_cgraph" alt=""/></div>
<map name="adev__io__i2c_8h_addb2a5d40257d803646950da9167bccb_cgraph" id="adev__io__i2c_8h_addb2a5d40257d803646950da9167bccb_cgraph">
<area shape="rect" title="IO 模拟标准 I2C, 主设备产生停止信号" alt="" coords="5,5,93,31"/>
<area shape="rect" href="dev__io__i2c_8c.html#a2f2fd2dc0cabe8d5843a078348d9920f" title="IIC 主设备产生停止信号" alt="" coords="141,5,271,31"/>
<area shape="rect" href="dev__io__i2c_8c.html#ab80cac38a78cf222153cd721d4801a3a" title="IIC 通讯的延时保持" alt="" coords="319,5,413,31"/>
</map>
</div>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
